package com.icas.util;

import org.springframework.util.ObjectUtils;

import java.text.SimpleDateFormat;

/**
 * @Author: tocchen
 * @Date: 2022/4/19 14:11
 * @Description
 **/
public class TimeUtils {
    /**
     * 秒级字符串时间戳转为时间字符串
     */
    public static String strToTimeStamp(long timeStamp){
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        return sdf.format(timeStamp * 1000);
    }

    /**
     * 时间戳转时间大小
     * @param time
     * @return
     */
    public static String Long2Time(Long time){
        if (ObjectUtils.isEmpty(time)){
            return null;
        }
        return time/1000/60+"";
    }
}
